<template>
	<view class="container">
		<cu-custom style="height: 0px !important;" bgColor="bg-blue" :isBack="true">
			<block slot="backText">返回</block>
			 <block slot="content">{{WorkFlowName}}</block>
		</cu-custom>
		<view  class="bg-top bg-blue">
			
			<view v-if='isSpare'>
				<view class="chooseBox">
					<view class="titleleftBox">
						<view class="choose">选择备件</view>
						<view class="rapid" @click="gotoCK()">点击选择</view>
					</view>
					<view class="select-icon" @click="gotoCK()"></view>
				</view>
				
				
				
				<!-- 出库历史查询 -->
				<!-- <view class="chooseBox" v-if="count>0">
					<view class="titleleftBox">
						<view class="choose">已出库备件</view>
						<view class="rapid" @click="lookFor(id)">点击查看</view>
					</view>
					<view class="select-icon" @click="lookFor(id)"></view>
				</view> -->
			</view>
			
			<view v-if="isFile">
				<!-- 仪器运行跟踪记录表  上传 调用接口   -->
				
				<view class="choosefile">
					<view class="fileTitle">
						<text>上传仪器运行跟踪记录表</text>
					</view>
					<uni-file-picker
						@delete="deleteFile"
						@select='selectFile'
						v-model="listFile"
						:del-icon="false"
						file-mediatype="all" 
					:auto-upload="false"></uni-file-picker>
					
				</view>

			</view>
			<view class="lookfile" v-if="showFileList.length > 0" >
				<view class="lookfileTitle">
					仪器运行跟踪记录表
				</view>
				<view class="fileBox">
					<view class="flies" v-for="(jtem, j) in showFileList" :key="j">
						<view class="detailFile">
							<img :src="fileSrc" alt="" />
							<view class="fileName">{{jtem.FileName}}</view>
							<view class="seeBtn" @click="lookJtem(jtem.FilePath)">查看</view>
						</view>
					</view>
				</view>
			</view>
			<active-form style="width:100% !important" :formDate.sync="formData" num></active-form>

			<view style="width: 100%;height: 180rpx;">
			</view>
			<view v-if="!isView" class="publish-goods-wrap">
				<view @click="tempsub" class="publish-goods-btn-left">暂存</view>
				<view @click="sub1"  class="publish-goods-btn-right" >结束提交</view>
			</view>
		</view>
	</view>
</template>

<script>
import ActiveForm from "@/components/active-form/active-form";
import request from '@/common/request.js';
import QQMapWX from "@/common/qqmap-wx-jssdk";
import time from "@/common/time.js";
//import fileSign from '@/static/filesSign.png'
export default {
  components: {
    ActiveForm,
  },
  data() {
    return {
		fileSrc:  request.baseUrl1+'/Resource/Sg/filesSign.png',
		Desc:'',
		qrcodeList:[],
		requestData:{
			Id:'',
			logId:'',
			Result:''
		},
		watermark:{
			UserName:'',
			JobName:'',
			nowTime:'',
			address:'',
			jingweidu:'',
			customerName:'',
			fileType:968,  //999工单，967 巡检强制拍照，968 巡检答题拍照，969 维保图片
			chooseAlbum:false,
			onlyShow:'false',
		},
		formDataBase: [
		],
        formData: [],
		noJob:0,
		list: [
			{
				name: '正常',
				disabled: false
			},
			{
				name: '异常',
				disabled: false
			}
		],
		value: '正常',
		id:'',
		NewStepId:'',
		isView: false,
		isSpare: false,
		isFile: false,
		WorkFlowName: '',
		listFile: [],
		showFileList: []
    };
  },
  onLoad(option){
	  this.id = option.Id
	  this.getFileId = option.getFileId || option.Id
	  this.NewStepId = option.NewStepId
	  this.isView = option.isView
	  this.isSpare = option.IsSpare
	  this.isFile = option.IsFile
	  this.WorkFlowName = option.WorkFlowName
	  if(option.IsShare){
		  this.GetSaveStepSByJoinIdList(option.JoinID)
	  }
	  this.requestData.logId = option.Id
	  this.requestData.Id = option.NewStepId
  
		if(option.onlyShow!=''&&option.onlyShow!=null&&option.onlyShow!=undefined){
			this.watermark.onlyShow=option.onlyShow
		}
	
		this.getSettings().then(() => {
			this.getTopicList()
		});
		
		this.GetfileListInfo()
		
	},
  onShow: function() {
  },
  methods: {
	  dialogToggle(type) {
	  	this.$refs.alertDialog.open()
	  },
	  SignExceptionAddSceneConfirm(){
	  	this.$refs.alertDialog.close()
		uni.navigateTo({
			url: '/pages/qrcode/scene/add/add?qrcodeid='+this.requestData.QrcodeId+'&Desc='+this.Desc
		})
	  },
	  SignExceptionAddSceneClose(){
	  	this.$refs.alertDialog.close()
		uni.showToast({ title:'添加成功', icon: '/static/success.png' });
		uni.getStorage({
			key: 'PageCur',
			success: function (res1) {
				setTimeout(() => {
					 uni.reLaunch({
						url: '/pages/index/tabbar?PageCur='+res1.data
					 });
				}, 0)
			},fail() {
				setTimeout(() => {
					 uni.reLaunch({
						url: '/pages/index/tabbar?PageCur=home'
					 });
				}, 0)
			}
		});
	  },
	getSettings(){
		let that=this
		return new Promise((resolve, reject) => {
			uni.getStorage({
				key: 'userdata',
				success: function (res1) {
					that.watermark.UserName=res1.data.RealName
				}
			});
			uni.getStorage({
				key: 'JobId',
				success: function (res) {
					that.watermark.JobName=res.data.jobname;
			}
			});
			var qqmapsdk;
			uni.getLocation({
				type: 'gcj02',
				isHighAccuracy:true,
				success: function(res) {
					that.watermark.jingweidu=res.latitude+','+res.longitude
					qqmapsdk = new QQMapWX({
						key: "XNEBZ-NVULW-O5QRJ-Y4NVA-RADE3-BEFA7" //自己申请的key
					});
					qqmapsdk.reverseGeocoder({
						location: {
							latitude: res.latitude,
							longitude: res.longitude
						},
						success(addressRes) {
							//console.log(addressRes)
							that.watermark.address = addressRes.result.address;
						},
						fail(res) {
							
						}
					});
				}
			});
			that.watermark.nowTime=time.getNow()
			let opts = {
				url: 'api/getCustomerName',
				method: 'get'
			};
			request.httpTokenRequest(opts).then(res => {
				if(res.data.code == 1){
					that.watermark.customerName=res.data.msg
					//console.log(that.watermark.customerName)
				}
				else{
					uni.showToast({ title: res.data.msg, icon: 'none' });
				}
			})	
			setTimeout(() => {
				resolve();
			}, 1000);
		});
	},
	
	GetSaveStepSByJoinIdList(JoinID){
		let that = this
		let opts = {
			url: 'WorkflowApi/GetSaveStepSByJoinIdList',
			method: 'get'
		}
		let param = {id: JoinID}
		request.httpTokenRequest(opts,param).then(res => {
		})
	},
	// 选中某个单选框时，由radio时触发
	radioChange(e) {
		//console.log(e);
	},
	// 选中任一radio时，由radio-group触发
	radioGroupChange(e) {
		//console.log(e);
	},
	getTopicList(){
		let that=this
		uni.showLoading({title: '加载中'})
		let opts;
		if(!that.isView){
			opts = {url: 'WorkflowApi/GetSetStepSList',method: 'get'};
		} else {
			opts = {url: 'WorkflowApi/GetViewStepSList',method: 'get'};
		}
		let param = {id: this.id}
		request.httpTokenRequest(opts,param).then(res => {
			if(res.data.code == 1){
				let fromData=[]
				let result=res.data.data;
				let list=[]
				for(let i=0;i<result.length;i++){
					list=[]
					let item=result[i]
					//1 单选，2 多选，3数字，4文字，5时间，6 下拉，7 图片，8 视频
					if(item.TopicType==1||item.TopicType==2){
						let fromItem={}
						for(let j=0;j<item.TopicOptionArry.length;j++){
							let listItem={}
							if(item.TopicType==1){
								listItem.value=item.TopicOptionArry[j]
								listItem.label=item.TopicOptionArry[j]
							}else{
								listItem.value=item.TopicOptionArry[j]
								listItem.name=item.TopicOptionArry[j]
							}
							list.push(listItem)
						}
						fromItem.id=item.Id;
						fromItem.placeholder=item.TopicTips;
						fromItem.label=item.TopicTitle+'：';
						fromItem.type=item.TopicType==1?'radio':'checkbox';
						fromItem.list=list;
						
						//console.log('准备赋值：'+item.Value)
						let rules={}
						rules.value=item.Value
						rules.name='result'+i;
						rules.label=item.Value
						rules.verify=item.Required==1?true:false;
						rules.errMess='';
						fromItem.rules=rules;
						if(item.TopicType==2){
							let ListCheckboxList=item.ListCheckboxList
							if(ListCheckboxList.length>0){
								let CheckboxList=[]
								if(ListCheckboxList!=null&&ListCheckboxList.length>0){
									for(let i=0;i<ListCheckboxList.length;i++){
										let CheckboxListEntity={}
										CheckboxListEntity.value=ListCheckboxList[i].value
										CheckboxListEntity.name=ListCheckboxList[i].name
										CheckboxListEntity.checked=ListCheckboxList[i].checked1
										CheckboxList.push(CheckboxListEntity)
									}
								}
								fromItem.list=CheckboxList
							}
						}
						//console.log("fromItem:"+JSON.stringify(fromItem))
						fromData.push(fromItem)
					}else if(item.TopicType==3){
						//3数字111
						let fromItem={}
						fromItem.id=item.Id;
						if(item.TopicUnit!=''){
							fromItem.placeholder=item.TopicTips+'('+item.TopicUnit+')';
						}else{
							fromItem.placeholder=item.TopicTips;
						}
						
						fromItem.label=item.TopicTitle+'：';
						fromItem.type='number';
						let rules={}
						//console.log('准备赋值：'+item.Value)
						rules.value=item.Value
						rules.name='result'+i;
						rules.label=item.Value
						rules.verify=item.Required==1?true:false;
						rules.errMess='';
						fromItem.rules=rules;
						fromData.push(fromItem)
					}else if(item.TopicType==4){
						//4文字
						let fromItem={}
						fromItem.id=item.Id;
						fromItem.placeholder=item.TopicTips;
						fromItem.label=item.TopicTitle;
						fromItem.type='textarea';
						let rules={}
						rules.value=item.Value
						rules.name='result'+i;
						rules.label='';
						rules.verify=item.Required==1?true:false;
						rules.errMess='';
						fromItem.rules=rules;
						fromData.push(fromItem)
					}else if(item.TopicType==5){
						//5时间
						let fromItem={}
						fromItem.id=item.Id;
						fromItem.label=item.TopicTitle;
						fromItem.type='time';
						let rules={}
						//console.log('准备赋值：'+item.Value)
						rules.name='result'+i;
						if(item.Value!=null&&item.Value!=''&&item.Value!=undefined){
							fromItem.placeholder=item.Value;
							rules.value=item.Value
							rules.label=item.Value
						}else{
							rules.value=''
							rules.label=''
							fromItem.placeholder='请选择';
						}
						rules.verify=item.Required==1?true:false;
						rules.errMess='';
						fromItem.rules=rules;
						fromData.push(fromItem)
					}
					else if(item.TopicType==6){
						let fromItem={}
						fromItem.id=item.Id;
						fromItem.placeholder="请选择";
						fromItem.label=item.TopicTitle;
						fromItem.type='select';
						fromItem.show=false
						fromItem.title="请选择"
						
						
						fromItem.list=item.selectOptions
						let rules={}
						
						//console.log('准备赋值：'+item.Value)
						rules.value=item.Value;
						rules.name='result'+i;
						rules.label=item.Value;
						rules.verify=item.Required==1?true:false;
						rules.errMess='请选择'+item.TopicTitle;
						fromItem.rules=rules;
						//console.log("select:"+JSON.stringify(fromItem.rules))
						fromData.push(fromItem)
					}else if(item.TopicType==7){
						let fromItem={}
						fromItem.id=item.Id;
						fromItem.placeholder="拍摄照片";
						fromItem.label=item.TopicTitle;
						fromItem.type='image';
						fromItem.show=false
						fromItem.title="请选择"
						
						//水印参数
						fromItem.watermark=that.watermark
						let ruleList=[]
						let rules1={}
						
						//console.log('准备赋值：'+item.ImageValues[0])
						if(item.ImageValues[0]!=undefined){
							rules1.value=item.ImageValues[0]
							
						}else{
							rules1.value=''
						}
						rules1.name='image1';
						rules1.verify=item.Required==1?true:false;
						rules1.errMess='请拍摄'+item.TopicTitle;
						ruleList.push(rules1)
						let rules2={}
						//console.log('准备赋值：'+item.ImageValues[1])
						if(item.ImageValues[1]!=undefined){
							rules2.value=item.ImageValues[1]
						}else{
							rules2.value=''
						}
						rules2.name='image2';
						rules2.verify=item.Required==1?true:false;
						rules2.errMess='请拍摄'+item.TopicTitle;
						ruleList.push(rules2)
						let rules3={}
						//console.log('准备赋值：'+item.ImageValues[2])
						if(item.ImageValues[2]!=undefined){
							rules3.value=item.ImageValues[2]
						}else{
							rules3.value=''
						}
						rules3.name='image3';
						rules3.verify=item.Required==1?true:false;
						rules3.errMess='请拍摄'+item.TopicTitle;
						ruleList.push(rules3)
						
						let rules4={}
						//console.log('准备赋值：'+item.ImageValues[3])
						if(item.ImageValues[3]!=undefined){
							rules4.value=item.ImageValues[3]
						}else{
							rules4.value=''
						}
						rules4.name='image4';
						rules4.verify=item.Required==1?true:false;
						rules4.errMess='请拍摄'+item.TopicTitle;
						ruleList.push(rules4)
						
						let rules5={}
						//console.log('准备赋值：'+item.ImageValues[4])
						if(item.ImageValues[4]!=undefined){
							rules5.value=item.ImageValues[4]
						}else{
							rules5.value=''
						}
						rules5.name='image5';
						rules5.verify=item.Required==1?true:false;
						rules5.errMess='请拍摄'+item.TopicTitle;
						ruleList.push(rules5)
						
						fromItem.rules=ruleList;
						//console.log('ImageRule:'+JSON.stringify(fromItem.rules))
						fromData.push(fromItem)
					}else if(item.TopicType==8){
						let fromItem={}
						fromItem.id=item.Id;
						fromItem.placeholder="拍摄视频";
						fromItem.label=item.TopicTitle;
						fromItem.type='video';
						fromItem.url=that.$request22.baseUrl
						fromItem.onlyShow=that.watermark.onlyShow
						
						let rules={}
						//console.log('准备赋值：'+item.Value)
						rules.name='video';
						rules.value=item.Value
						rules.verify=item.Required==1?true:false;
						rules.errMess='请拍摄'+item.TopicTitle;
						fromItem.rules=rules;
						fromData.push(fromItem)
					}else if(item.TopicType==9){
						let fromItem={}
						fromItem.id=item.Id;
						fromItem.placeholder="上传文件";
						fromItem.label=item.TopicTitle;
						fromItem.fileList = []
						fromItem.type='file';
						fromItem.url=that.$request22.baseUrl
						fromItem.onlyShow=that.watermark.onlyShow
						
						let rules={}
						//console.log('准备赋值：'+item.Value)
						rules.name='file';
						rules.value=item.Value
						rules.isView=this.isView
						rules.verify=item.Required==1?true:false;
						rules.errMess='请上传'+item.TopicTitle;
						fromItem.rules=rules;
						fromData.push(fromItem)
					}
					else{
						let fromItem={}
						fromItem.id=item.Id;
						fromItem.placeholder=item.TopicTips;
						fromItem.label=item.TopicTitle+'：';
						fromItem.type='textarea';
						let rules={}
						rules.value=item.Value
						rules.name='result'+i;
						rules.label='';
						rules.verify=item.Required==1?true:false;
						rules.errMess='';
						fromItem.rules=rules;
						fromData.push(fromItem)
					}
				}
				that.formData=[]
				that.formData=fromData
				// that.formData.push(that.formDataBase[0])
				// that.formData.push(that.formDataBase[1])
				
				
				uni.hideLoading();
			}
			else{
				uni.hideLoading();
				uni.showToast({ title: res.data.msg, icon: 'none' });
			}
		})	
	},
	
	 tempsub(){
			let that=this
			
			let opts = {
				url: 'WorkflowApi/AnswerTopic?IsOk=0',
				method: 'post'
			};
			that.requestData.Result=JSON.stringify(that.formData)
			request.httpTokenRequest(opts,that.requestData).then(res => {
				that.isButtonDisabled1 = false;
				if(res.data.code == 1){
					uni.hideLoading();
					uni.showToast({ title:'暂存成功', icon: '/static/success.png' });
					uni.getStorage({
						key: 'PageCur',
						success: function (res1) {
							setTimeout(() => {
								uni.reLaunch({
									url: '/pages/index/tabbar?PageCur='+res1.data
								});
							}, 0)
						},fail() {
							setTimeout(() => {
								 uni.reLaunch({
									url: '/pages/index/tabbar?PageCur=home'
								 });
							}, 0)
						}
					});
				}
				else{
					uni.hideLoading();
					uni.showToast({ title: res.data.msg, icon: 'none' });
				}
			})
		},
		sub1(){
			let that=this
			uni.showModal({
				title: '提示',
				content: '确认结束本次维保内容吗？',
				success: function (res) {
					if (res.confirm) {
						that.sub();
					}
				}
			});
		},
    // 提交表单
    sub() {
		//console.log(JSON.stringify(this.formData))
		this.$vervify(this.formData); //表单校验 成功会继续往下走 失败抛出异常
		const res = this.$submitForm(this.formData); //校验成功 获取表单值
		uni.showLoading({
			title: '提交中'
		})
		
		let that=this
		//console.log(JSON.stringify(that.formData))
		let opts = {
			url: 'WorkflowApi/AnswerTopic?IsOk=1',
			method: 'post'
		};
		that.requestData.Result=JSON.stringify(that.formData)
		request.httpTokenRequest(opts,that.requestData).then(res => {
			that.isButtonDisabled1 = false;
			if(res.data.code == 1){
				uni.hideLoading();
				uni.showToast({ title:'暂存成功', icon: '/static/success.png' });
				// uni.navigateBack({
				// 	delta: 1 //返回层数，2则上上页
				// });
				let opts = {
					url: 'WorkflowApi/IsContinueOperation',
					method: 'get'
				};
				let param = {
					WorkId: that.id
				}
				request.httpTokenRequest(opts,param).then(res => {
					console.log(res.data.Data)
					let dataID = res.data.Data.Id
					let isSpare = res.data.Data.IsSpare
					let joinID = res.data.Data.JoinID
					let NewStepId = res.data.Data.NewStepId
					let IsShare = res.data.Data.IsShare
					let WorkFlowName = res.data.Data.WorkFlowName
					let IsFile = res.data.Data.IsFile
					if(dataID!=''&&dataID!=null&&dataID!=undefined){
						
						uni.showModal({
							title: '提示',
							content: '是否进行下一步填写',
							success: function (res) {
								if (res.confirm) {
									uni.navigateBack({
										delta: 1 //返回层数，2则上上页
									});
									uni.navigateTo({
										url: '/pages-workflow/flowTopic?Id='+dataID+'&IsSpare='+isSpare+'&JoinID='+joinID+'&NewStepId='+NewStepId+'&IsShare'+IsShare+'&WorkFlowName='+WorkFlowName+'&IsFile='+IsFile
									})
								} else {
									that.goHome()
								}
							}
						});
						
					} else {
						that.goHome()
					}
				})

			} else {
				uni.hideLoading();
				uni.showToast({ title: res.data.msg, icon: 'none' });
			}
		})
		
	},
	
	goHome(){
		uni.getStorage({
			key: 'PageCur',
			success: function (res1) {
				setTimeout(() => {
					 uni.reLaunch({
						url: '/pages/index/tabbar?PageCur='+res1.data
					 });
				}, 0)
			},fail() {
				setTimeout(() => {
					 uni.reLaunch({
						url: '/pages/index/tabbar?PageCur=home'
					 });
				}, 0)
			}
		});
	},
	
	gotoCK(){
		let that = this
		uni.navigateTo({
			url: '/pages-workflow/outSpace?type=out'+'&logId=' + that.id
		})
	},
	//  获取用户的地理位置，
	getLocation() {
		const that = this
		uni.getLocation({
			type: 'gcj02',
			//altitude: true,
			isHighAccuracy:true,
			success(res) {
				that.requestData.Longitude=res.longitude;
				that.requestData.Latitude=res.latitude;
			}
		})
	},
	GetfileListInfo(){
		let that = this
		let opts = {
			url: 'WorkflowApi/GetfileListInfo',
			method: 'get'
		};
		let param = {
			id: that.getFileId
		};
		request.httpTokenRequest(opts,param).then(res => {
			if (res.data.code == 1) {
				that.showFileList = res.data.data
			} else {
				uni.showToast({ title: res.data.msg, icon: 'none' });
			}
		})
	},
	lookJtem(jtem){
		console.log('jtem',request.baseUrl1+jtem)
		uni.downloadFile({
			url: request.baseUrl1+jtem,
			success(res){
				if (res.statusCode == 200) {
					console.log('下载成功')
					let filePath = encodeURI(res.tempFilePath)
					uni.openDocument({
						filePath: encodeURI(filePath),
						showMenu: true,
						success:function(res){
							console.log('打开文档成功')
						},
						fail(e){
							console.log('打开失败', e)
						}
					})
				} else {
					console.log('下载失败')
				}
			}
		})
	},
	selectFile(res){
		let that=this
		let {tempFiles, tempFilePaths} = res
		
		tempFiles.forEach(ele => {
			console.log('ele饿了', ele)
			let {name, url, uuid, file, extname} = ele
			that.listFile.push({
				name, url, uuid, file,
			})
			if (extname == "xlsx" || extname == "xls" ) {
				new Promise((resolve, reject) => {
					let token =uni.getStorageSync('userdata').token;
					let customerName =uni.getStorageSync('userdata').FileName;
					
					// for(let i=0;i<that.listFile.length;i++){
						// let file = that.listFile[i]
						// let tempFile=file.url
						let tempFile=url
						uni.uploadFile({
							url: this.$request22.baseUrl1+'/File/UploadMutilesFiles?customerName='+customerName, 
							filePath: tempFile,
							name: 'fileList',
							method: 'post',
							header: {
								'Content-Type': 'multipart/form-data; charset=UTF-8' ,// 在这里设置编码
								'token': token,
							},
							success: (uploadFileRes) => {
								let result=JSON.parse(uploadFileRes.data)
								console.log('result',uploadFileRes)
								if(result.Tag==1){
									console.log(result.Data[0])
									console.log(that.listFile)
									that.listFile[that.listFile.length - 1].value = that.$request22.baseUrl1+result.Data[0];
									// uni.showToast({ title:'上传成功', icon: 'none' });
									uni.showModal({
										title: '',
										content: '确认上传',
										showCancel: false, // 禁用取消按钮
										success: function (res) {
											if (res.confirm) {
												// that.uploadServiceLife(that.$request22.baseUrl1+result.Data[0],file.name);
												that.uploadServiceLife(result.Data[0],name, {tempFile:ele});
											}
										}
									});
								}
							},fail(err) {
								console.log(err)
								uni.hideLoading();
								uni.showToast({ title:'上传失败', icon: 'none' });
								that.deleteFile({tempFile: {uuid}})
							}
						});
					// }
				})
			} else {
				uni.showToast({ title:'请选择excel文件', icon: 'none' });
				that.deleteFile({tempFile: {uuid}})
			}
			
		})

	},
	uploadServiceLife(filePath, fileName, tempFile){
		let that = this
		let opts = {
			url: 'WorkflowApi/UploadServiceLife_TrackingTableInfo',
			method: 'post'
		};
		let param = {
			"FilePath": filePath, //文件地址
			"FileName": fileName, //文件名称
			"logId":  that.id//id和备件一样
		}
		request.httpTokenRequest(opts,param).then(res => {
			if (res.data.code == 1) {
				console.log('res', res)
				uni.showToast({ title: res.data.msg, icon: 'none' });
			} else {
				uni.showToast({ title: res.data.msg, icon: 'none' });
				setTimeout(()=>{
					that.deleteFile(tempFile)
				}, 500)
			}
		})
	},
	// 删除文件
	deleteFile(res){
		let that=this
		console.log('删除的文件', res)
		let {tempFile: {uuid}} = res
		let Index = null
		let tar = that.listFile.filter((file) => file.uuid == uuid)
		
		console.log('tar', tar)
		// if (typeof Index == 'number') {
		// 	that.listFile.splice(Index, 1)
		// }
		uni.showLoading({
			title: '删除中...'
		})
		let opts = {
			url: 'api/DeleteQiNiuFile',
			method: 'get'
		};
		let params={
			filePath:tar[0].value,
			isComplete:true
		}
		request.httpTokenRequest(opts,params).then(res => {
			uni.hideLoading();
			if(res.data.code == 1){
				that.listFile = that.listFile.filter((file) => file.uuid != uuid)
			    // that.formDate2[index].rules.value = "";
			    // this.$emit("update:formDate", this.formDate2);
			}
			else{
				uni.showToast({ title: res.data.msg, icon: 'none' });
			}
		});
	},
	
  },
};
</script>

<style lang="less" scoped>
.form-item .flex-row--c{
	width: 100%;
}
.container {
	width: 750rpx;
	color: #333333;
	.imagesclass{
		width:33%;
		float:left;
		.imagesclassdetail{
			width: 100px !important;
			height: 100px !important;
			margin-right: 20px;
		}
	}
	.bg-top {
		margin-top: -1rpx;
		width: 750rpx;
		height: 220rpx;
		padding-top: 30rpx;
		border-radius: 0 0 20% 20%;

		.top-box {
			width: 700rpx;
			background-color: #FFFFFF;
			margin: 0 auto;
			border-radius: 20rpx;
			padding: 20rpx 30rpx 0rpx;
			position: relative;
		}
		.chooseBox{
			width: 95%;
			background-color: #fff;
			margin: auto;
			margin-top: 10rpx;
			border-radius: 20rpx;
			padding: 47rpx 30rpx 27rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;
			.titleleftBox{
				display: flex;
				align-items: center;
				width: 80%;
			}
			.titlerightBox{
				display: flex;
				align-items: right;
				font-size: 26rpx;
				//color:#0079FE;
				font-weight: 500;
				line-height: 40rpx;
				height: 40rpx;
			}
			.choose{
				padding-left: 10rpx;
				font-weight: 600;
				font-size: 28rpx;
				color: #000000;
			}
			.rapid{
				font-size: 28rpx;
				font-weight: 500;
				margin-left: 20rpx;
				color: #333;
				width: 70%;
			}
			.select-icon{
				float: right;
				border-bottom: 2upx solid #999;
				border-right: 2upx solid #999;
				width: 16upx;
				height: 16upx;
				transform: rotate(-45deg);
				margin-right: 30rpx;
			}
		}
		.choosefile{
			width: 95%;
			background-color: #fff;
			margin: auto;
			margin-top: 10rpx;
			border-radius: 20rpx;
			padding: 47rpx 30rpx 27rpx;
			.fileTitle {
				color: #000;
				font-size: 28rpx;
				font-weight: 600;
				margin-bottom: 20rpx;
			}
		}
		.lookfile{
			width: 95%;
			background-color: #fff;
			margin: auto;
			margin-top: 10rpx;
			border-radius: 20rpx;
			padding: 27rpx 30rpx;
			
			.lookfileTitle{
				color: #000;
				font-size: 28rpx;
				font-weight: 600;
				margin-bottom: 20rpx;
			}
			.fileBox{
				max-height: 250rpx;
				overflow-y: scroll;
				.flies {
					.detailFile{
						display: flex;
						align-items: center;
						justify-content: space-between;
						margin: 15rpx 0;
						>img{
							width: 55rpx;
							height: (200/176)*55rpx;
						}
						.fileName{
							flex: 1;
							margin: 0 15rpx;
							overflow: hidden;
							text-overflow: ellipsis;
							color: #000;
							// 单行
							// white-space: nowrap;
							
							// 多行
							display: -webkit-box;
							-webkit-line-clamp: 2; /* 限制行数 */
							-webkit-box-orient: vertical;
						}
						.seeBtn{
							border-radius: 15rpx;
							padding: 7rpx 25rpx;
							color: #fff;
							background: linear-gradient(45deg,rgba(20,178,181,100%),rgba(43,194,161,100%));
						}
					}
				}
			}
		}
	}
	.subform {
		margin:40rpx auto;
		width: 90%;
		text-align: center;
	  padding: 20rpx 60rpx;
	  border-radius: 18rpx;
	  background-color: #0081ff;
		color: white;
	}
}
.content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  .subform {
	left: 5%;
	bottom: 8%;
	width: 90%;
	text-align: center;
    padding: 20rpx 60rpx;
	margin-bottom: 40rpx;
    border-radius: 18rpx;
    background-color: #0081ff;
	color: white;
  }
}

	.publish-goods-wrap {
		background: rgba(255, 255, 255, .5);
		padding: 24rpx;
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		z-index: 10;
	}

	.publish-goods-btn {
		margin: 24rpx;
		background: #0079FE;
		color: #FFFFFF;
		height: 82rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		border-radius: 82rpx;
	}

	.goods-empty-wrap {
		display: flex;
		align-items: center;
		justify-content: center;
		margin-top: 40%;
	}
	
	.content {
	  display: flex;
	  flex-direction: column;
	  align-items: center;
	  justify-content: center;
	  padding-top: 30rpx;
	}
	
	.each{
		width: 100%;
	}
	.repairType{
		border-radius:16rpx 16rpx 0 0;
		box-sizing: border-box;
		width: 94%;
		margin: 0 3%;
		background-color: #fff;
		height: 80rpx;
		line-height: 80rpx;
		padding: 0 25rpx;
		font-weight: 600;
		font-size: 34rpx;
		border-bottom:1px solid rgba(242, 242, 242, 1)
	}
	.repairBox{
		border-radius: 0 0 16rpx 16rpx;
		box-sizing: border-box;
		width: 94%;
		margin: 0 3% 0rpx 3%;
		padding: 25rpx ;
		background-color: #fff;
		justify-content: space-around;//实现水平方向均匀布局，space-between水平靠左靠右
		text-align: center;
		.selectType{
			width: 26%;
			height: 60rpx;
			line-height: 60rpx;
			color: #409eff;
			background-color: #f6faff;
			border:1px solid rgba(160, 207, 255, 1);
			border-radius: 5px;
		}
		.eachType{
			width: 26%;
			height: 60rpx;
			line-height: 60rpx;
			color: #999999;
			background-color: #fff;
			border:1px solid rgb(233, 233, 233);
			border-radius: 5px;
			font-size: 38rpx;
		}
	}
	.publish-goods-btn-left {
			width: 44%;
			margin: 12rpx;
			background: #0079FE;
			color: #FFFFFF;
			height: 82rpx;
			display: flex;
			align-items: center;
			justify-content: center;
			border-radius: 82rpx;
			float: left;
		}
		.publish-goods-btn-right {
			width: 44%;
			margin: 12rpx;
			background: #e54d42;
			color: #FFFFFF;
			height: 82rpx;
			display: flex;
			align-items: center;
			justify-content: center;
			border-radius: 82rpx;
			float: right;
		}
		
		.progress-container {
			position: fixed;
			top: 0;
			left: 0;
			z-index: 99;
			background: rgba(0, 0, 0, .2);
			width: 750rpx;
			height: 100vh;
			display: flex;
			align-items: center;
			justify-content: center;
			.progress-box {
				background: #FFFFFF;
				border-radius: 20rpx;
				padding: 30rpx;
				.text {
					margin-bottom: 20rpx;
				}
			}
		}
</style>